#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.61])
AC_INIT([libfake437], [0.5], [endgame.dos@gmail.com])
AC_CONFIG_AUX_DIR([auxfiles])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_SRCDIR([include/fake437.h])
AM_INIT_AUTOMAKE([foreign 1.10 subdir-objects -Wall -Werror])
AM_SILENT_RULES([yes])
LT_INIT([win32-dll])
AC_SUBST([LIBTOOL_DEPS])

AC_ARG_ENABLE(
  [examples],
  [AS_HELP_STRING(
    [--enable-examples],
    [Also build the example programs @<:@default=no@:>@])],
  [:],
  [enable_examples=no])
AM_CONDITIONAL([ENABLE_EXAMPLES], [test "$enable_examples" = yes])

AC_ARG_WITH(
  [pkg-config-dir],
  [AS_HELP_STRING(
    [--with-pkg-config-dir=DIR],
    [Put pkg-config files in DIR @<:@default=LIBDIR/pkgconfig@:>@])],
  [pkgconfigdir=$withval],
  [pkgconfigdir=$libdir/pkgconfig])
AC_SUBST([pkgconfigdir])

# Checks for programs.
AC_PROG_SED
AC_PROG_CC
AC_PROG_CXX

# Checks for libraries.
PKG_CHECK_MODULES([SDL], [sdl], [:],
                  [AC_MSG_ERROR([SDL is required to build.])])
SDL_L_FLAGS=`$PKG_CONFIG --libs-only-L sdl`
AC_SUBST([SDL_L_FLAGS])

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AM_PROG_CC_C_O

# Checks for library functions.

# Output.
AC_CONFIG_FILES([fake437.pc fake437++.pc])
AC_CONFIG_FILES([Makefile doc/Makefile])
AC_OUTPUT
